cssprovider: Export gtk_css_provider_load_named) function
authorBenjamin Otte <otte@redhat.com>
Wed, 19 Sep 2012 14:15:05 +0000 (16:15 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 31 Oct 2012 10:09:09 +0000 (11:09 +0100)
... and document it.
For now, the function is only exported internally.

gtk/gtkcssprovider.c
gtk/gtkcssproviderprivate.h

index 203b90252ecfc45f7b9e56a1b44004f1c1891613..92506ee6d2c04e232830e423a5b4efb6c379c778 100644 (file)
@@ -2692,10 +2692,22 @@ _gtk_css_provider_get_theme_dir (void)
   return path;
 }
 
-static void
-gtk_css_provider_load_named (GtkCssProvider *provider,
-                             const gchar    *name,
-                             const gchar    *variant)
+/**
+ * _gtk_css_provider_load_named:
+ * @provider: a #GtkCssProvider
+ * @name: A theme name
+ * @variant: (allow-none): variant to load, for example, "dark", or
+ *     %NULL for the default
+ *
+ * Loads a theme from the usual theme paths. The actual process of
+ * finding the theme might change between releases, but it is
+ * guaranteed that this function uses the same mechanism to load the
+ * theme than GTK uses for loading its own theme.
+ **/
+void
+_gtk_css_provider_load_named (GtkCssProvider *provider,
+                              const gchar    *name,
+                              const gchar    *variant)
 {
   gchar *subpath, *path;
   gchar *resource_path;
@@ -2813,7 +2825,7 @@ gtk_css_provider_get_named (const gchar *name,
   if (!provider)
     {
       provider = gtk_css_provider_new ();
-      gtk_css_provider_load_named (provider, name, variant);
+      _gtk_css_provider_load_named (provider, name, variant);
       g_hash_table_insert (themes, g_strdup (key), provider);
     }
   
index 9a242547a8739a095d6d1a7d19b563d42e4f19e2..807a2053824570948eccea4183c891a6f2c44db5 100644 (file)
@@ -24,6 +24,10 @@ G_BEGIN_DECLS
 
 gchar *_gtk_css_provider_get_theme_dir (void);
 
+void   _gtk_css_provider_load_named    (GtkCssProvider *provider,
+                                        const gchar    *name,
+                                        const gchar    *variant);
+
 G_END_DECLS
 
 #endif /* __GTK_CSS_PROVIDER_PRIVATE_H__ */